/*
 * @Descripttion: 实现instanceof
 * @version: 1.0.0
 * @Author: 某人
 * @Date: 2021-06-07 09:33:43
 */
function instanceOf (left, right) {
  let proto = Object.getPrototypeOf(left)
  while(true) {
    if (proto === null) return false
    if (proto === right.prototype) {
      return true
    }
    proto = proto.__proto__
  }
}
(function () {
  let arr = [1, 2, 3, 4]
  console.log(instanceOf(arr, Array))
}())
